package cn.rubintry.bug.hunting.common.http.viewmodel

import androidx.activity.ComponentActivity
import androidx.lifecycle.MutableLiveData
import cn.rubintry.bug.hunting.common.http.api.WebApi
import cn.rubintry.bug.hunting.pojo.BaseModel
import cn.rubintry.bug.hunting.pojo.VersionDataModel
import cn.rubintry.bug.lib.network.http.NetApiManager
import cn.rubintry.bug.lib.network.http.viewmodel.BaseViewModel

class AppViewModel() : BaseViewModel()  {

    val versionData = MutableLiveData<BaseModel<VersionDataModel>>()

    fun checkVersion() {
        request(NetApiManager.getInstance().getApi(WebApi::class.java),
            WebApi::getLastVersion,false ,{ data ->
                data?.let {
                    versionData.postValue(it)
                }
            })
    }


}